
import java.math.BigDecimal;
import java.util.Date;

// Customer类
 class Customer {
    private String name;
    private String contact;
    private String deliveryAddress;
    private boolean active;

    public Customer(String name, String contact, String deliveryAddress, boolean active) {
        this.name = name;
        this.contact = contact;
        this.deliveryAddress = deliveryAddress;
        this.active = active;
    }

    public Order placeOrder() {
        // 简化实现，实际应包含更多逻辑
        return new Order();
    }


}

public class Order {
    private Date createDate;
    private String status;

    public Order() {
        this.createDate = new Date(); // 设置为当前日期
        this.status = "CREATE"; // 初始状态为CREATE
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

}

// OrderDetail类
 class OrderDetail {
    private int quantity;

    public OrderDetail(int quantity) {
        this.quantity = quantity;
    }

    public BigDecimal calculateSubTotal(Product product) {
        // 简化实现，实际应包含更多逻辑
        return product.getPriceForQuantity(quantity);
    }

    public double calculateWeight(Product product) {
        // 简化实现，实际应包含更多逻辑
        return product.getWeight() * quantity;
    }


}

// Product类
 class Product {
    private String title;
    private double weight;
    private String description;

    public Product(String title, double weight, String description) {
        this.title = title;
        this.weight = weight;
        this.description = description;
    }

    public BigDecimal getPriceForQuantity(int quantity) {
        // 简化实现，实际应包含更多逻辑
        return new BigDecimal("0"); // 假设价格为0
    }

    public double getWeight() {
        return weight;
    }


}

// Payment抽象类
 abstract class Payment {
    protected BigDecimal amount;

    public Payment(BigDecimal amount) {
        this.amount = amount;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    // 支付方法的具体实现由子类完成
}

// Credit类
 class Credit extends Payment {
    private String number;
    private String type;
    private String expireDate;

    public Credit(BigDecimal amount, String number, String type, String expireDate) {
        super(amount);
        this.number = number;
        this.type = type;
        this.expireDate = expireDate;
    }


}

// Cash类
 class Cash extends Payment {
    private BigDecimal cashTendered;

    public Cash(BigDecimal amount, BigDecimal cashTendered) {
        super(amount);
        this.cashTendered = cashTendered;
    }

}

// WireTransfer类
 class WireTransfer extends Payment {
    private String bankID;
    private String bankName;

    public WireTransfer(BigDecimal amount, String bankID, String bankName) {
        super(amount);
        this.bankID = bankID;
        this.bankName = bankName;
    }

}

// AliPay类
 class AliPay extends Payment {
    private String number;

    public AliPay(BigDecimal amount, String number) {
        super(amount);
        this.number = number;
    }

}

// WeixinPay类
 class WeixinPay extends Payment {
    private String number;

    public WeixinPay(BigDecimal amount, String number) {
        super(amount);
        this.number = number;
    }
}
